package com.zijiebutiao.mapper;

import com.zijiebutiao.pojos.TMember;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
* @author ZhangQingTian
* @description 针对表【t_member】的数据库操作Mapper
* @createDate 2023-03-07 20:28:28
* @Entity com.zijiebutiao.pojos.TMember
*/
@Repository
public interface TMemberMapper extends BaseMapper<TMember> {
        @Select("select count(*) from t_member where regTime=CURDATE()")
        Long todayNewMember();
        @Select("select count(*) from t_member where regTime between SUBDATE(CURDATE(),DATE_FORMAT(CURDATE(),'%w')-1) and SUBDATE(CURDATE(),DATE_FORMAT(CURDATE(),'%w')-7)")
        Long weekNewMember();
        @Select("select count(*) from t_member where regTime between DATE_ADD(CURDATE(),INTERVAL -DAY(CURDATE())+1 DAY) and LAST_DAY(CURDATE())")
        Long monthNewMember();
        @Select("select count(*) from t_member")
        Long memberCount();
}




